Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monorepo #138

Merged
merged 44 commits into from
Jan 5, 2025
Merged

Monorepo #138

merged 44 commits into from
Jan 5, 2025

Conversation

suddenlyGiovanni
Copy link
Owner

@suddenlyGiovanni suddenlyGiovanni commented Dec 28, 2024

The main change introduced by this PR is the decoupling of my resume from the resume-schema encoder and decoder. It has been accomplished by migrating this project to a monorepo composed of separate packages, each with its own responsibility.

This pull request includes several changes to the configuration and setup files, improvements to the workflow, and updates to the project structure. The most important changes are grouped by theme and listed below:

Configuration and Setup Improvements:

  • Added node installation and npm configuration steps to setup/action.yml and updated pnpm cache setup.
  • Updated .changeset/config.json to include @suddenlygiovanni/* in the fixed packages list.
  • Updated .npmrc to change the virtual store directory to node_modules/.pnpm.

Workflow Enhancements:

  • Modified published.yml to build and publish only @suddenlygiovanni/schema-resume package.
  • Replaced Biome setup and linting steps with pnpm commands in pull-request-checks-workflow.yml and push-checks-workflow.yml. [1] [2]

Project Structure and File Organization:

  • Added configuration files for Biome and JSON schema mappings in the .idea directory. [1] [2] [3]
  • Updated package.json to make the package private and simplified the scripts and dependencies.
  • Created a new biome.json file for the resume package and updated its package.json with necessary configurations. [1] [2]

Testing and Linting:

  • Added a new test file resume.spec.ts for the resume package.
  • Updated integration-test.spec.ts to reflect the new file structure.

TypeScript Configuration:

  • Added tsconfig.json for the resume package with strict type checking configurations.
  • Added vitest.config.ts for the resume package to configure test settings.

Copy link

changeset-bot bot commented Dec 28, 2024

🦋 Changeset detected

Latest commit: 3a01202

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 92 out of 98 changed files in this pull request and generated no comments.

Files not reviewed (6)
  • .changeset/config.json: Language not supported
  • .idea/jsonSchemas.xml: Language not supported
  • .npmrc: Language not supported
  • package.json: Language not supported
  • packages/resume/package.json: Language not supported
  • packages/schema-resume/package.json: Language not supported
.npmrc Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[misspell] reported by reviewdog 🐶
"behaviour" is a misspelling of "behavior"

resume/.npmrc

Line 110 in fb10f60

; If this is enabled, the primary behaviour of pnpm install becomes that of

@@ -23,8 +23,9 @@ jobs:

- name: 🏗️Run Build
run: pnpm run build
run: pnpm run --filter @suddenlygiovanni/schema-resume build
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[actionlint] reported by reviewdog 🐶
key "run" is duplicated in element of "steps" section. previously defined at line:25,col:9 [syntax-check]

suddenlyGiovanni and others added 11 commits January 4, 2025 14:02
Migrated the project to a monorepo structure with defined workspaces. Added separate packages for `resume` and `schema-resume` with updated dependencies and exports. Updated configs, lockfiles, and schema references to align with the restructuring.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Updated the package version to 13.3.1 and removed workspaces from package.json. These changes streamline configuration relevant to the module and ensure alignment with the latest versioning demands.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Updated multiple dependencies in pnpm-lock.yaml, including '@vitest/coverage-v8' and '@types/node' to newer versions. Removed unused entries for '@vitest/ui' and 'vite-tsconfig-paths' as part of cleanup.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Added the `files` field to ensure the correct files are included during package publishing. This prevents accidental exclusion of necessary build artifacts.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Ensure the build and publish steps target only @suddenlygiovanni/schema-resume. This prevents unintended actions on unrelated packages during the workflow.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Adjusted spacing issues in the .npmrc configuration for scoped registries. This ensures proper parsing and avoids potential issues with npm authentication or package access.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Updated dependencies to their latest versions in pnpm-lock.yaml, including fastq to 1.18.0, vite to 6.0.7, and package-manager-detector to 0.2.8. This ensures compatibility with the latest updates and resolves potential dependency issues.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Added a new .idea/webResources.xml file to configure web resource paths for the project. This ensures proper indexing and mapping of resource roots in the IDE for the specified packages.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Added a local `schema.json` file to the `resume` package and modified schema references accordingly. Updated Node.js TypeScript configuration to `node23` and included the new `effect` dependency in `resume` package. Removed unnecessary `publishConfig` from `resume` package settings.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Added @std/yaml as a devDependency for YAML handling and exposed `schema.json` in the package exports. Also migrated integration tests from `schema-resume` to `resume` module for better modularity.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Unified JSON formatting for configuration files across modules, including indentation and array styles. This change improves code readability and maintains consistency throughout the codebase. Minor fixes to import order in Vitest configurations were also included.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Refactor biome.json to improve readability by reformatting JSON
structure. Added overrides for snapshot files to disable formatter.
This ensures consistent handling and better maintainability of
configuration files.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Adjusted the biome configuration to exclude "schema.json" in the "resume" package. Also updated the global overrides to include "schema.json" for snapshot-specific settings. This ensures proper file handling and formatting exclusions.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
suddenlyGiovanni and others added 6 commits January 4, 2025 14:18
Reorganized imports within test files for better consistency. Removed unnecessary dependency on `vite-tsconfig-paths` to streamline `package.json` and cleaned up `pnpm-lock.yaml` to drop unused packages for reduced overhead.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Renamed the workspace configuration file to use the correct `.yaml` extension. This improves file consistency and adheres to standard naming conventions.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Added scripting commands for type checking, formatting, and testing in `package.json`. Removed redundant project-specific lockfiles in favor of a unified one to streamline dependency management.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Switched the "effect" dependency to use the catalog reference instead of a version specifier. Updated pnpm workspace and lock files accordingly to reflect this change.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
suddenlyGiovanni and others added 15 commits January 4, 2025 18:09
Refined scripts for formatting, linting, and type-checking using Biome. Updated `tsconfig.json` to include Node types and adjusted Biome config to override linter rules for test files.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Replaced inline Biome setup and lint commands with a centralized script for consistency and simplicity. Updated test and lint commands to use recursive (-r) options for improved workspace handling.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Reorganized and adjusted import paths to align with module structure. This ensures better clarity and consistency across the codebase in tests. No functional changes introduced.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Add explicit Node.js installation and .npmrc configuration for private registry. Update pnpm setup to include cache configuration for efficient dependency management. Adjust dependency installation to support recursive mode.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Updated the file path to resume.yml in the integration test to ensure it resolves correctly. This fixes issues with locating the file during test execution.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Added `vitest` and `@vitest/coverage-v8` to `devDependencies` in `package.json`. Updated `pnpm-lock.yaml` with new entries for Vitest-related packages and their dependencies to support testing and coverage functionality.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Removed an outdated test that compared JSON schema snapshots. This cleanup improves code maintainability by removing unused dependencies and unnecessary test artifacts.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Replaced pnpm test command with Vitest in PR checks workflow. Updated Vitest configuration to use GitHub Actions reporters conditionally, enhancing CI reporting.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Added "description", "name", and "private" fields to the package.json file. This improves the package metadata and ensures it adheres to best practices for npm packages.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Added the `enableLspFormat` option to the Biome settings. This allows leveraging LSP for formatting, improving development workflows.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Moved coverage configuration to the root `vitest.config.ts` to ensure consistent setup across all packages. Removed duplicate and redundant coverage settings from individual package configurations.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Introduces @vitest/ui as a new development dependency,
aligning with updated versions of vitest. Updates pnpm
lockfile accordingly to ensure proper resolution of
dependencies.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Revised the Codecov action to use a specific JSON file for uploads
and moved the token to the `env` section. Also modified the
coverage report configuration in Vitest to remove the HTML
reporter.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Copy link

codecov bot commented Jan 4, 2025

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

suddenlyGiovanni and others added 5 commits January 4, 2025 23:19
Updated the Vitest command to include the 'run' subcommand
for clarity and proper execution. This ensures consistent
behavior and avoids potential issues in CI workflows.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Changed the virtual-store-dir configuration to align with the default `node_modules/.pnpm` path. This ensures consistent behavior and avoids potential path-related issues.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Updated package dependencies to use pnpm catalog references instead of explicit versions across multiple modules. This ensures consistency and centralized management of dependency versions within the workspace.

Signed-off-by: suddenlyGiovanni <15946771+suddenlyGiovanni@users.noreply.github.com>
Relocated `resume.yml` and `schema.json` into the `src` directory for better structure. Updated import paths in tests and `package.json` to reflect the new locations. This enhances maintainability and clarity within the module.
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 96 out of 110 changed files in this pull request and generated 1 comment.

Files not reviewed (14)
  • .changeset/config.json: Language not supported
  • .idea/biome.xml: Language not supported
  • .idea/jsonSchemas.xml: Language not supported
  • .idea/webResources.xml: Language not supported
  • .npmrc: Language not supported
  • biome.json: Language not supported
  • package.json: Language not supported
  • packages/resume/biome.json: Language not supported
  • packages/resume/package.json: Language not supported
  • packages/resume/tsconfig.json: Language not supported
  • packages/schema-resume/biome.json: Language not supported
  • packages/schema-resume/package.json: Language not supported
  • packages/resume/src/integration-test.spec.ts: Evaluated as low risk
  • .changeset/shiny-seas-check.md: Evaluated as low risk

import { describe, expect, it } from 'vitest'

describe('Resume', () => {
it('jsonSchema match its snapshot', async () => {
Copy link
Preview

Copilot AI Jan 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The test description 'jsonSchema match its snapshot' is grammatically incorrect. It should be 'JSON schema matches its snapshot'.

Suggested change
it('jsonSchema match its snapshot', async () => {
it('JSON schema matches its snapshot', async () => {

Copilot is powered by AI, so mistakes are possible. Review output carefully before use.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
Updated include and ignore paths to reflect correct schema file
locations. Ensured consistency with file structure by including
"resume.yml" in the ignore list.
Removed Biome setup in favor of a custom GitHub action to manage dependencies. Refactored format and lint scripts to simplify usage and improve consistency across the project. This streamlines workflow configuration and reduces external dependencies.
@@ -16,31 +16,17 @@ jobs:
with:
fetch-depth: 0

- name: 🧬 Setup Biome
uses: biomejs/setup-biome@v2

- name: 👣 Retrieve Git REF
run: echo "GIT_REF=$(git rev-parse origin/main)" >> $GITHUB_ENV
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[actionlint] reported by reviewdog 🐶
shellcheck reported issue in this script: SC2086:info:1:48: Double quote to prevent globbing and word splitting [shellcheck]

@suddenlyGiovanni suddenlyGiovanni marked this pull request as ready for review January 5, 2025 22:53
@suddenlyGiovanni suddenlyGiovanni merged commit 1e7ef96 into main Jan 5, 2025
9 checks passed
@suddenlyGiovanni suddenlyGiovanni deleted the monorepo branch January 5, 2025 22:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant